#include "WordList.h"
#include <cstdlib> // For rand() and srand()
#include <ctime>   // For time()

WordList::WordList() {
    // Initialize the word bank with some words
    wordBank = {"apple", "banana", "orange", "grape", "pear", "peach", "melon", "kiwi", "plum", "cherry"};
    // Seed the random number generator
    srand(static_cast<unsigned int>(time(nullptr))); // 将 time_t 类型转换为 unsigned int 类型
}

std::string WordList::getRandomWord() const {
    int randomIndex = rand() % wordBank.size();
    return wordBank[randomIndex];
}
